package net.xdclass.config;

import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;

/**
 * @Author NJUPT wly
 * @Date 2021/9/28 9:57 下午
 * @Version 1.0
 */
public class AlipayConfig  {

    /**
     * appId
     */
    public static final String APPID = "2021000118625205";

    /**
     * 应用私钥
     */
    public static final String APP_PRI_KEY = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCB7ypWg6hADh9be46OORk4fcyjTmoBFheDoD6F3mj+mkr2gfrgbfVGvJmWJBkbdNlbspv2/SV7HJl1Y0deZzcmiA9qpTcIVluJ4cFkiDbQoIHExDbmA4XZOYDPNw3gQZ0gfk5zPrlnD38u5mAJURrg8OcSZTfRJ1FGMMGovBEhLtjfpyweQnoLRlmOvCjZ6U5ylwC5yRYYVwQw0SdiSW4bB24xYlRyc4rgsxciYurbNIF31SMwdxQa0GY65CtCr7YAJQV2YEwe4f5hrVcWx96qluY2zumxu5cX/IMfoHtjmTlpS9b32e+3zID+2YYHtvlTO2V+CzljcSlwTvushqMnAgMBAAECggEAVYWV2FvP4llpSk2JBxOOBiDHELYMD6r6zygp/vLlKK9lp9rlxdKaHnUEok4gOHIwnqpw/aChiubIGvu9feVx52qmuwsDrfkpRxfQstr1OVxsDZcYi0zGTLQMlFcoSvLk+P4ppLEkVzFcBQKdM4SurF/jt7fnhULbu9dboDQpEi1TTHzILYrkrHzjQZMSQxjOhbMCrai1G+qi1uRjseo26/w3Pz2uhGwLzf5oFcotMtnflYwRiskLQJWaJQ+pDpBJp5GX7GLglOB2xO8FHWhxfPyhp2LRd36TZQTKswuVSjKZrTtQiPa6JcWWfq3nZwp3FfDXL70b6VPH3DZMAzvQAQKBgQC9oXBQm9urotDlN+4bUI7VL8hwH8io4nSia/Geh2GUhl3MmbG83sO2wRdRmnSeEZkqJ1eNm4lzCe20/O3I/zCUF1LwRJTSpwkBm0Zq2vO/e2fRAAv4SxzW0mcXEg9GPZWBsJ6DPIPaMcTlaf/R6PIQgB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rA3N+qfycLQdtz0JRCSm7J/LtY0JocDjZZQkSwMVJbodjkurhBUg44+d8fx6k503BQ1gURp3uHAX6wIDAQAB";

    /**
     * 签名类型
     */
    public static final String SIGN_TYPE = "RSA2";

    /**
     * 字符编码
     */
    public static final String CHARSET = "UTF-8";

    /**
     * 返回参数格式
     */
    public static final String FORMAT = "json";

    /**
     * 支付宝网关
     */
    public static final String PAY_GATEWAY = "https://openapi.alipaydev.com/gateway.do";


    private AlipayConfig(){

    }

    private volatile static AlipayClient instance = null;

    /**
     * 单例模式
     * @return
     */
    public static AlipayClient getInstance(){
        if (instance == null){
            synchronized (AlipayConfig.class){
                if (instance == null){
                    instance = new DefaultAlipayClient(PAY_GATEWAY,APPID,APP_PRI_KEY,FORMAT,CHARSET,ALIPAY_PUB_KEY,SIGN_TYPE);
                }
            }
        }
        return instance;
    }


}
